<?php

/**
 * Update resource detail infomation
 *
 * @author Jensen
 */
class updateItemDetail extends AbstractAction {

    public function run() {
        $itemId = intval($_GET['id']);
        $largeimgurl = cleanInput($_GET['largeimgurl']);
        $doubanrating = cleanInput($_GET['doubanrating']);
        $doubansubtype = cleanInput($_GET['doubansubtype']);
        $doubanid = intval($_GET['doubanid']);
        $year = intval($_GET['year']);
        $originaltitle = cleanInput($_GET['originaltitle']);

        $callback = cleanInput($_GET['callback']);

        $itemDAO = new BTItemsDAO();
        if ($itemDAO->UpdateItemDetail($itemId, $largeimgurl, $doubanrating, $doubansubtype, $doubanid, $year, $originaltitle)) {
            jsonp_output($callback, 0, 'OK');
        } else {
            jsonp_output($callback, 1, 'update failed');
        }
    }

}

?>
